<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
 <TITLE>SDCC Compiler User Guide: int (16 bit) and long (32 bit ) support.</TITLE>
 <LINK HREF="SDCCUdoc-15.html" REL=next>
 <LINK HREF="SDCCUdoc-13.html" REL=previous>
 <LINK HREF="SDCCUdoc.html#toc14" REL=contents>
</HEAD>
<BODY>
<A HREF="SDCCUdoc-15.html">Next</A>
<A HREF="SDCCUdoc-13.html">Previous</A>
<A HREF="SDCCUdoc.html#toc14">Contents</A>
<HR>
<H2><A NAME="int and long"></A> <A NAME="s14">14. int (16 bit) and long (32 bit ) support.</A> </H2>

<P>For signed &amp; unsigned int (16 bit) and long (32 bit) variables, division,
multiplication and modulus operations are implemented by support routines.
These support routines are all developed in ANSI-C to facilitate porting to
other MCUs. The following files contain the described routine, all of them
can be found in the directory SDCCDIR/sdcc51lib
<P>
<UL>
<LI>_mulsint.c - signed 16 bit multiplication (calls _muluint)</LI>
<LI>_muluint.c - unsigned 16 bit multiplication</LI>
<LI>_divsint.c - signed 16 bit division (calls _divuint)</LI>
<LI>_divuint.c - unsigned 16 bit division.</LI>
<LI>_modsint.c - signed 16 bit modulus (call _moduint)</LI>
<LI>_moduint.c - unsigned 16 bit modulus.</LI>
<LI>_mulslong.c - signed 32 bit multiplication (calls _mululong)</LI>
<LI>_mululong.c - unsigned32 bit multiplication.</LI>
<LI>_divslong.c - signed 32 division (calls _divulong)</LI>
<LI>_divulong.c - unsigned 32 division.</LI>
<LI>_modslong.c - signed 32 bit modulus (calls _modulong).</LI>
<LI>_modulong.c - unsigned 32 bit modulus.</LI>
</UL>
<P>All these routines are compiled as non-reentrant and small model. Since
they are compiled as non-reentrant, interrupt service routines should not do
any of the above operations, if this unavoidable then the above routines will
need to ne compiled with the --stack-auto option, after which the source program
will have to be compiled with --int-long-rent option.
<HR>
<A HREF="SDCCUdoc-15.html">Next</A>
<A HREF="SDCCUdoc-13.html">Previous</A>
<A HREF="SDCCUdoc.html#toc14">Contents</A>
</BODY>
</HTML>
